<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Examples</title>
    <meta name="keywords" content="">
    <link href="" rel="stylesheet">

    <script type="text/javascript" src="./vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="userInput" @input="handleInput()">
        <ul>
            <li v-for="item in dataList">
                {{item}}
            </li>
        </ul>
    </div>

    <script>
        new Vue({
            el: "#app",
            data: {
                userInput: "你妹",
                dataList: ["abc", "bcd", "cde", "def", "fgh"],
                list: ["abc", "bcd", "cde", "def", "fgh"]
            },
            methods: {
                handleInput() {
                    this.dataList = this.list.filter(
                        value => (value.indexOf(this.userInput) > -1)
                    )
                }
            }
        })
    </script>
</body>

</html>